//l_utility.hpp
#ifndef L_UTILITY_HPP
#define L_UTILITY_HPP

extern "C" {
    #include "hiredis/sds.h"   
}

#ifndef LUAJIT_2_0
#define LUAJIT_2_0
#include <luajit-2.0/lua.hpp>
#endif

#define __BIZ_CODE_DIR "biz-code"
#define __MASTER_LUA "master.lua"
#define __PREALLOCATE_SDS_LENGTH 1024
#define __WEBQUEUE_TABLE "wq"
#define __WEBQUEUE_REQUEST "request"
#define __WEBQUEUE_REPLY "reply"
#define __WEBQUEUE_BUFFER "buf"


namespace http {
    namespace server3 {

        typedef struct Util_Table_SI{
          const char *key;
          int value;
        } Util_Table_SI;

        int  l_register_table_SI(lua_State* L, int n,
                                 Util_Table_SI *arr, const char* table_name);

        /************************************************************************/
        /* Register cac ham trong l_utility vao lua                                                                    */
        /* Moi ham se duoc dang ky mot ten vao global index trong lua                                                                    */
        /************************************************************************/
        int l_register_utility(lua_State* L);
    }
}
#endif
